<?php
declare (strict_types = 1);

namespace app\admin\controller;

use app\common\controller\Backend;
use hg\apidoc\annotation as Apidoc;

/**
 * 短信管理
 * @Apidoc\Group("base")
 * @package app\admin\controller
 */
class Sms extends Backend
{
    /**
     * 初始化参数
     * @author 贾二小
     * @since 2021/7/3
     */
    public function initialize()
    {
        $this->config = [
            'name'=>'短信管理',
            'table_name'=>'sms',//表名
            'table_alias' => 'a',//别名
            'table_field'=>'*',//显示默认字段
            'form_field' => 'id,phone_numbers,validate_code,template_code,biz_id,status,source,invalid_time',//表单字段，没有设置则默认为显示字段默认是不能有*和.)
            'form_validated1' => [
                'name' => ['msg' => '名称为空', 'regex' => false, 'pcre' => '',],
                'code' => ['msg' => 'code为空', 'regex' => false, 'pcre' => '',],
            ],//表单验证
            'form_validated2' => ['code'],//重复验证
            'search_table'=> null,//关联表时，需要重写
            'is_limit'=> true,//是否分页显示
            'search_field' => 'id,phone_numbers,validate_code,template_code,biz_id,status,source,invalid_time',//查询表格字段
            'search_param'=>[
                ['field' => 'phone_numbers', 'type' => '=', 'param'=> 'phone_numbers'],
                ['field' => 'status', 'type' => '=', 'param'=> 'status'],
                ['field' => 'source', 'type' => '=', 'param'=> 'source'],
            ],//查询表格条件
            'is_delete'=> false,//是否假删除
            'id_validated' => [
                'id' => ['msg' => 'ID不能为空', 'regex' => false, 'pcre' => '',],
            ],//表单验证
        ];
        parent::initialize(); // TODO: Change the autogenerated stub
    }

    //用户登录名称 oss@1679141728527008.onaliyun.com
    //AccessKey ID LTAI5tQutyxPugByKVkPaoAm
    //AccessKey Secret 0y4mOaI52ArlOSwjoKmwTFyDhQDL5d
}